<!-- Begin page content -->
<main role="main" class="container">
    <h1 class="mt-5 mb-4">地址簿 Address Book</h1>
    <!-- Bootstrap Grid -->

    <?php isset($listMsg) && print($listMsg); ?>

    <div class="row">
        <div class="col-sm-10 justify-content-md-center"><?php isset($pager) && print($pager); ?></div>
        <div class="col-sm-2"><a href="<?php echo BASE_URL; ?>/user/create" class="btn btn-primary">创造 Create</a></div>

        <table class="table table-striped table-bordered table-hover">
            <thead class="thead-light">
                <tr>
                    <th>ID</th>
                    <th>姓名 <br>Name</th>
                    <th>电子邮件 <br>Email Address</th>
                    <th>手机号码 <br>Mobile Number</th>
                    <th>行动 <br>Action</th>
                </tr>
            </thead>
            <tbody>
                <?php foreach ($arrData as $row) { ?>
                <tr>
                    <td><?php isset($row['id']) && print($row['id']); ?></td>
                    <td><?php isset($row['name']) && print($row['name']); ?></td>
                    <td><?php isset($row['email']) && print($row['email']); ?></td>
                    <td><?php isset($row['mobile']) && print($row['mobile']); ?></td>
                    <td><a class="btn" href="<?php echo BASE_URL; ?>/user/<?php isset($row['id']) && print($row['id']); ?>">选择 Read</a>
                        <a class="btn btn-success" href="<?php echo BASE_URL; ?>/user/update/<?php isset($row['id']) && print($row['id']); ?>">修改 Update</a>
                        <a class="btn btn-danger" href="<?php echo BASE_URL; ?>/user/delete/<?php isset($row['id']) && print($row['id']); ?>">删除 Delete</a>
                    </td>
                </tr>
                <?php } ?>
            </tbody>
        </table>
    </div>
    <div class="row justify-content-md-center">
        <?php isset($pager) && print($pager); ?>
    </div>
</main>